<template>
  <div class="cont">
    
    <div class="box">
        <!-- w内容 -->
    <el-table :data="datau" style="width:100%" border>
      <el-table-column label="注册日期">
        <template slot-scope="scope">
          {{ scope.row.createTime | formatTimer }}
        </template>
      </el-table-column>

      <!-- ----------------------------------------- -->
      <el-table-column prop="uid" label="编号"> </el-table-column>
      <el-table-column prop="email" label="邮箱号码">
      </el-table-column>
      <el-table-column label="操作"> </el-table-column>
    </el-table>
    </div>
    <el-pagination
    class="b"
      background
      layout="prev, pager, next"
      :total="Pagination.total"
      style="margin: 20px 20px 20px 0px"
      @current-change="currentchange"
      :page-size="Pagination.pageSize"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      datau: [],
      Pagination: {
        page: 1,
        pageSize: 5,
        total: 2,
      },
    };
  },
  mounted() {
    this.uess();
  },
  methods: {
    //分页
    currentchange(z) {
      this.Pagination.page = z;
      this.uess();
    },
    uess() {
      this.$http
        .get("/user/", {
          page: this.Pagination.page,
          pageSize: this.Pagination.pageSize,
        })
        .then((res) => {
          console.log(res);
          this.datau = res.data;
          this.Pagination.total = res.total;
          console.log(this.datau);
        });
    },
  },
};
</script>

<style scoped>
.cont{
    animation: fadeInLeft; /* referring directly to the animation's @keyframe declaration */
  animation-duration: 0.9s;
}
.b{
    padding-left: 20px;
    width: 500px;
    /* border: 1px solid #000; */
}
.box{
  
  padding: 15px;
  padding-right: 45px;
    /* margin-top: 25px; */
}
</style>